<%
if (_.isEmpty(role_links.where({
	slug: "add_board"
}))) {
	var delete_github_obj = apps;
	if (delete_github_obj.hasOwnProperty('r_import_github')) {
		delete delete_github_obj['r_import_github'];
	}
}
%>
	<section id="cookie_information" class="hide hidden-xs">
		<div class="js-cookie-information-row row navbar navbar-default list-group-item-text"></div>
	</section>
	<section class="action-block action-content">
		<div class="row navbar navbar-default list-group-item-text">
			<ul class="nav nav-pills navbar-left">
				<li class="footer-logo active">
					<a href="javascript:void(0);" title="<%- SITE_NAME %>" class="js-start visible-xs hidden-sm hidden-md hidden-lg">
						<img src="img/logo-icon.png" alt="[Images: <%- SITE_NAME %>]" title="<%- SITE_NAME %>" data-container="body" id="js-footer-brand-img"
						/>
					</a>
					<a href="#" title="<%- SITE_NAME %>" class="js-start js-footer-board-link hidden-xs">
							<img src="img/logo-icon.png" alt="[Images: <%- SITE_NAME %>]" title="<%- SITE_NAME %>" data-container="body" id="js-footer-brand-img"
							/>
						</a>
					<!-- Todo: quick fix. load image before offline. call after when goes offline
	<img src="img/logo-icon-offline.png" alt="[Images: <%- SITE_NAME %>]" style="display:none;" /> -->
				</li>
				<% if(!_.isUndefined(authuser.user)){%>
					<li class="hidden-xs music-btn pa">
						<% if(board_id !== undefined && board_id !== null && board_id !== "" && !_.isEmpty(this.music_content) && this.music_content !== ''){ %>
							<% if(parseInt(authuser.user.is_productivity_beats) === 1) { %>
								<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>"
								 title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action"
								 data-type='on'>
									<span class="show">
										<i class="icon-volume-up lead audio-animation show"></i>
									</span>
								</a>
								<% } else { %>
									<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>"
									 title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action"
									 data-type='off'>
										<span class="show">
											<i class="icon-volume-off lead text-muted show"></i>
										</span>
									</a>
									<% } %>
										<% } %>
					</li>
					<% } else { %>
						<li class="hidden-xs music-btn pa">
							<% if(board_id !== undefined && board_id !== null && board_id !== "" && !_.isEmpty(this.music_content) && this.music_content !== ''){ %>
								<% if($.cookie('music_play') === "1") { %>
									<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>"
									 title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action"
									 data-type='on'>
										<span class="show">
											<i class="icon-volume-up lead show"></i>
										</span>
									</a>
									<% } else { %>
										<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>"
										 title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action"
										 data-type='off'>
											<span class="show">
												<i class="icon-volume-off lead show text-muted"></i>
											</span>
										</a>
										<% } %>
											<% } %>
						</li>

						<% }%>
							<% if(!_.isUndefined(authuser.user)){%>
								<li class="dropdown hidden-xs board-btn">
									<a title="<%- i18next.t('Dashboard') %>" href="#" data-toggle="dropdown" class="btn btn-default js-show-boards-list">
										<span>
											<%- i18next.t("Boards") %>
										</span>
										<span>
											<i class="icon-collapse"></i>
										</span>
									</a>
									<ul role="menu" class="dropdown-menu js-dropdown-popup col-xs-12 js-show-add-boards-list">
										<li class="js-show-boards-list-response"></li>
										<% if(!_.isEmpty(role_links.where({slug: "view_board_search"}))){ %>
											<li class="clearfix js-qsearch-container js-boards-list-container">
												<div class="clearfix h6 col-xs-12">
													<input type="text" placeholder="<%- i18next.t('Find boards by name...') %>" class="js-search-boards form-control" id="inputBoardSearch"
													 title="Find boards by name...">
												</div>
											</li>
											<li class="divider"></li>
											<% } %>
												<%

			if (!_.isEmpty(role_links.where({
				slug: "view_closed_boards"
			}))) {
		%>
													<li class="clearfix js-closed-board-list dropdown dropdown-submenu dropdown js-boards-list-container-search">
														<a href="#" class="js-board-dropdown dropdown-toggle js-open-popover js-closed-boards" data-toggle="dropdown" title="<%- i18next.t('Closed Boards') %>">
															<%- i18next.t("Closed Boards") %>
														</a>
														<ul class="sidebar-boards-list js-closedboard-list  list-unstyled list-group dropdown-menu pre-scrollable vertical-scrollbar"></ul>
													</li>
													<%
			}
			if (!_.isEmpty(role_links.where({
				slug: "view_stared_boards"
			}))) {
		%>
														<li class="clearfix js-board-dropdown js-stared-board-lists dropdown-submenu dropdown js-boards-list-container-search">
															<a href="#" class="dropdown-toggle js-open-popover js-starred-boards" data-toggle="dropdown" title="<%- i18next.t('Starred Boards') %>">
																<%- i18next.t("Starred Boards") %>
															</a>
															<ul class="sidebar-boards-list js-board-starred-list list-unstyled list-group dropdown-menu pre-scrollable vertical-scrollbar"></ul>
														</li>
														<%
			}

			if (!_.isEmpty(role_links.where({
				slug: "view_my_boards"
			}))) {
		%>
															<li class="clearfix js-my-board-lists dropdown-submenu dropdown js-boards-list-container-search">
																<a href="#" class="js-board-dropdown dropdown-toggle js-open-popover js-my-boards-listing" data-toggle="dropdown" title="<%- i18next.t('My Boards') %>">
																	<%- i18next.t("My Boards") %>
																</a>
																<ul class="sidebar-boards-list js-myboard-list list-unstyled list-group dropdown-menu pre-scrollable vertical-scrollbar"></ul>
															</li>
															<%
			} 		
		%>
															<% if(!in_boards_page) { %>
																<li class="clearfix js-boards-list-container-search js-a">
																	<a href="#/boards" title="<%- i18next.t('Boards') %>">
																		<%- i18next.t("Boards") %>
																	</a>
																</li>
															<% } %>
																<%

			if (!_.isEmpty(role_links.where({
				slug: "add_board"
			})) || !_.isEmpty(role_links.where({
				slug: "add_organization"
			}))) {
		%>
																	<li class="divider js-boards-list-container-search"></li>
																	<li class="js-boards-list-container-search dropdown clearfix">
																		<a title="<%- i18next.t('Add Board or Organization') %>" class="dropdown-toggle js-show-organizations-board-from btn btn-link"
																		 data-toggle="dropdown" href="#">
																			<span class="pull-left">
																				<i class="icon-plus"></i>
																			</span>
																			<%- i18next.t("Add Board or Organization") %>
																		</a>
																		<ul role="menu" class="dropdown-menu dropdown-menu-right js-show-organizations-board-from-response js-dropdown-popup navbar-btn"></ul>
																	</li>
																	<%   
			 }
		%>
									</ul>
								</li>
								<% if(typeof(model.user) !== "undefined" && !_.isEmpty(model.user) && (!_.isEmpty(role_links.where({slug: "view_organization_listing"})))){ %>
									<li class="hidden-xs org-btn">
										<a title="<%- i18next.t('Organizations') %>" href="#/organizations" class="btn btn-default">
											<span>
												<%- i18next.t("Organizations") %>
											</span>
										</a>
									</li>
									<% } %>
									<% if(typeof(model.user) !== "undefined" && !_.isEmpty(model.user) && !_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null && APPS.enabled_apps.indexOf('r_wiki') !== -1 && !_.isEmpty(authuser.user) && !_.isUndefined(authuser.user) && (!_.isEmpty(role_links.where({slug: "get_pages"})))){ %>
										<li class="hidden-xs org-btn">
											<a title="<%- i18next.t('Wiki') %>" href="javascript:void(0);" class="btn btn-default js-view-wiki-menu">
												<span>
													<%- i18next.t("Wiki") %>
												</span>
											</a>
										</li>
									<% } %>
										<% if(apps !== ""){ %>
											<li class="dropdown hidden-xs board-btn js-show-add-apps-list add-apps-list">
												<a title="<%- i18next.t('Apps') %>" href="#" data-toggle="dropdown" class="btn btn-default js-show-apps-list">
													<span>
														<%- i18next.t("Apps") %>
													</span>
													<span>
														<i class="icon-collapse"></i>
													</span>
												</a>
												<ul role="menu" class="dropdown-menu js-dropdown-popup col-xs-12 pre-scrollable vertical-scrollbar">
													<% if (!_.isEmpty(apps) && apps.length !== 0) {
														_.each(apps, function(key,value) { 
															if (APPS.enabled_apps.indexOf(key.id) !== -1 && (key.price === 'Free' || (!_.isEmpty(role_links.where({
																slug: key.id
															})) || parseInt(authuser.user.role_id) === 1))) { %>
																<li id="<%- value %>" class="org-btn">
																	<a title="<%- i18next.t(key.name) %>" href="#" data-toggle="modal" data-target="#<%- key.id %>_modal" class="highlight-icon clearfix js-appModal-open">
																		<span style="background-image:url(<%- key.icon %>); background-size:cover;" class="preview-thumbnail"></span>
																		<span class="details btn-block navbar-btn">
																			<%- i18next.t(key.name) %>
																		</span>
																	</a>
																</li>
															<% } 
														});
													 } %>
															<li class="divider js-apps-list-container-search"></li>
															<li class="dropdown clearfix">
																<a title="<%- i18next.t('Add Apps') %>" class="dropdown-toggle  btn-link" target="_blank" href="http://restya.com/board/apps/?utm_source=Restyaboard - <%- SITE_NAME %>&utm_medium=web&utm_campaign=add_apps_footer">
																	<span class="pull-left">
																		<i class="icon-plus"></i>
																	</span> &nbsp;
																	<%- i18next.t("Add Apps") %>
																</a>
															</li>
												</ul>
											</li>
											<% } %>
												<% } %>
			</ul>
			<div class="js-appModalContent">
				<% if (!_.isEmpty(apps) && apps.length !== 0) {
					_.each(apps, function(key,value) {
						if (!_.isEmpty(authuser.user) && !_.isUndefined(authuser.user) && APPS.enabled_apps.indexOf(key.id) !== -1 && (key.price === 'Free' || (!_.isEmpty(authuser.user) && !_.isUndefined(authuser.user) && !_.isEmpty(role_links.where({slug: key.id})) || parseInt(authuser.user.role_id) === 1))) { %>
					<div class="modal fade" id="<%- key.id %>_modal" tabindex="-1" role="dialog" aria-labelledby="<%- key.name %>ModalLabel"
					aria-hidden="false">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal">
										<span aria-hidden="true" id="js-appModal-close">×</span>
										<span class="sr-only">Close</span>
									</button>
									<div class="media list-group-item-heading">
										<div class="pull-left">
											<img class="img-circle" width="36" height="36" src="<%- key.icon %>" />
										</div>
										<div class="media-body">
											<h4 class="modal-title" id="exampleModalLabel">
												<%- key.name %>
											</h4>
											<div>
												<span class="text-muted">v
													<%- key.version %>
												</span> By
												<a target="_blank" href="<%- key.author_url %>?utm_source=restyaboard&utm_medium=apppopup" title="author">
													<%- key.author %>
												</a>
											</div>
										</div>
									</div>
								</div>
								<div class="modal-body import-block">
									<% if (!_.isEmpty(key.large_description) && !_.isUndefined(key.large_description)) { %>
										<%= converter.makeHtml(key.large_description) %>
											<% } else { %>
												<span>
													<%- key.description %>
												</span>
												<% } %>
								</div>
								<div class="modal-footer">
									<% if (!_.isUndefined(key.sponsor) && !_.isEmpty(key.sponsor)) { %>
										<p class="pull-left">
											<strong>
												<%- i18next.t('Sponsor') %></strong>:
											<%- key.sponsor %>
										</p>
										<% } %>
											<a href="javascript:void(0);" title="<%- i18next.t('Close') %>" class="btn btn-primary js-appModal-close">
												<%- i18next.t("Close") %>
											</a>
								</div>
							</div>
						</div>
					</div>
					<% }
					});
				} %>
			</div>
			<div class="navbar-right clearfix">
				<ul class="nav nav-pills navbar-right">
					<% if(!_.isUndefined(authuser.user)){%>
						<% if((navigator.userAgent.toLowerCase().indexOf('android') > -1) && (navigator.userAgent.toLowerCase().indexOf('chrome') > -1)){ %>
							<li class="hidden-xs">
								<a href="#" tittle="<%- i18next.t('Install this webapp to your phone') %>" data-toggle="modal" data-target="#add_home_modal"
								 class="btn btn-default pull-right">
									<i class="icon-plus"></i>
								</a>
							</li>
							<% } %>
								<% if (!_.isUndefined(authuser.user) &&  !_.isEmpty(model.user)) { %>
									<li class="phone-block">
										<a class="btn btn-primary pull-right js-show-qr-code hidden-xs" id="phone" title="<%- i18next.t('View in iOS App') %>" href="">
											<i class="icon-mobile-phone lead"></i>
										</a>
									</li>
									<% } %>
										<% if (!_.isUndefined(authuser.user) &&  !_.isEmpty(model.user) && model.user.role_id == 1) { %>
											<li class="hidden-xs">
												<a title="<%- i18next.t('Admin CP') %>" class="btn btn-default pull-right admin-cp" href="#/activities">
													<span class="icon-user lead text-primary"></span>
													<span class="hidden-xs text-primary">
														<%- i18next.t("Admin") %>
													</span>
												</a>
											</li>
											<% } %>
												<li class="dropdown  instant_cards">
													<a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-default pull-right" title="<%-model.user.full_name%> (<%-model.user.username%>)">
														<span class="js-user-img">
															<% if(!_.isEmpty(model.user.profile_picture_path)){ 
				var profile_picture_path = model.showImage('User', model.user.id, 'micro_thumb', true);
			%>
																<img class="img-rounded" width="16" height="16" src="<%= profile_picture_path%>" alt="[Images: <%- model.user.username%>]"
																 title="<%- model.user.username%>" />
																<% }else{ %>
																	<i class="avatar avatar-color-194 avatar-sm">
																		<%- model.user.initials%>
																	</i>
																	<% } %>
														</span>&nbsp;
														<b class="caret"></b>
													</a>
													<ul class="dropdown-menu text-left js-change-avatar-form-response">
														<li>
															<a title="<%- i18next.t('Logout') %>" href="#/users/logout">
																<%- i18next.t("Logout") %>
															</a>
														</li>
														<li class="divider"></li>
														<li>
															<a href="#"  title="<%- i18next.t('Shortcuts') %>"  class="js-show-shortcuts-modal" data-toggle="modal" data-target="#ModalShortcutView">
																<%- i18next.t('Shortcuts') %>
															</a>
														</li>
														<% if(model.is_show_enable_notification === true) { %>
															<li>
																<a title="<%- i18next.t('Enable Desktop Notification') %>" href="#" class="js-enable-desktop-notification">
																	<%- i18next.t("Enable Desktop Notification") %>
																</a>
															</li>
															<% } %>
																<% if(!_.isEmpty(role_links.where({slug: "user_changepassword"})) && parseInt(authuser.user.is_ldap) === 0){ %>
																	<li>
																		<a title="<%- i18next.t('Change Password') %>" href="#/users/<%-model.user.id%>/changepassword">
																			<%- i18next.t("Change Password") %>
																		</a>
																	</li>
																	<% } %>
																		<% if(!_.isEmpty(role_links.where({slug: "view_user"}))){ %>
																			<li>
																				<a title="<%- i18next.t('Profile') %>" href="#/user/<%-model.user.id%>">
																					<%- i18next.t("Profile") %>
																				</a>
																			</li>
																			<% } %>
																				<li>
																					<a title="<%- i18next.t('About Restyaboard') %>" href="#/about">
																						<%- i18next.t("About Restyaboard") %>
																					</a>
																				</li>
																				<% var site_url = window.location.origin; %>
																					<li>
																						<a title="<%- i18next.t('Donate Restyaboard') %>" target="_blank" href="http://restya.com/donate/?utm_source=Restyaboard - <%- SITE_NAME %>&utm_medium=web&utm_campaign=footer">
																							<%- i18next.t('Donate Restyaboard') %>
																						</a>
																					</li>
																					<li class="dropdown-submenu dropdown language-dropdown">
																						<a href="#" data-toggle="dropdown" class="dropdown-toggle js-open-popover" title="<%- i18next.t('Change Language') %>">
																							<span>
																								<i class="icon-caret-left"></i>
																							</span>
																							<%- i18next.t('Change Language') %>
																						</a>
																						<ul class="dropdown-menu text-left js-change-language-form-response pre-scrollable vertical-scrollbar">
																							<% _.each(JSON.parse(languages), function(v, k) { %>
																								<li>
																									<a class="cur <% if(k !== authuser.user.language) { %>js-change-language<%}%>" data-lang="<%- k %>">
																										<%- v %>
																											<% if((!_.isEmpty(authuser.user.language) && k === authuser.user.language) || (_.isEmpty(authuser.user.language) && k === DEFAULT_LANGUAGE)){ %>
																												<i class="icon-ok"></i>
																												<% } %>
																									</a>
																								</li>
																								<% }); %>
																									<li class="divider"></li>
																									<li>
																										<a href="http://transifex.com/restya/restyaboard/?utm_source=Restyaboard&utm_medium=web&utm_campaign=translation_footer"
																										 target="_blank" title="<%- i18next.t('Contribute to Translation') %>">
																											<span class="pull-left">
																												<i class="icon-plus"></i>
																											</span>&nbsp;
																											<%- i18next.t('Contribute to Translation') %>
																										</a>
																									</li>
																						</ul>
																					</li>
													</ul>
												</li>
												<li class="dropdown notifications pull-right hidden-xs chat_icons">
													<a data-toggle="dropdown" href="#" class="btn btn-default pull-right js-show-notification" title="Notifications">
														<sup class="badge notification-count hide js-notification-count"></sup>
														<i class="icon-bell lead"></i>
													</a>
													<div id="all_activities" class="tabbable tabs-below dropdown-menu pull-right js-dropdown-popup" role="menu">
														<div class="tab-content bg-info clearfix">
															<div class="col-xs-12 user-filter navbar-btn">
																<span class="pull-left">
																	<strong>
																		<%- i18next.t('Activity') %>
																	</strong>
																</span>
																<ul class="nav nav-pills pull-right mob-no-mar">
																	<li id="modal-activities">
																		<a href="#" title="<%- i18next.t('Filter by activities') %>" class="text-muted">
																			<i class="icon-time small"></i>
																		</a>
																	</li>
																	<li id="modal-comments">
																		<a href="#" title="<%- i18next.t('Filter by comments') %>" class="text-muted">
																			<i class=" icon-comment-alt small"></i>
																		</a>
																	</li>
																</ul>
															</div>
															<div class="tab-pane js-all-activity-list notification-list vertical-scrollbar col-xs-12 border-top" id="all_">
																<ul id="js-all-activities" class="list-unstyled clearfix navbar-btn"></ul>
															</div>
															<% if(!_.isEmpty(board_id)) { %>
																<div class="tab-pane js-boards-activity-list active notification-list vertical-scrollbar col-xs-12 border-top" id="board_">
																	<ul id="js-board-activities" class="list-unstyled clearfix navbar-btn"></ul>
																</div>
																<% } %>
																	<% if(!_.isEmpty(board_id) && board_id !== 0 && board_id !== '0') { %>
																		<div class="col-xs-12 border-top text-center js-load-link" id="js-load-link1">
																			<a href="#" title="View all activity" id="js-notification-load-more" class="js-board-load-more btn btn-link">
																				<%- i18next.t("Load more activities") %>
																			</a>
																		</div>
																		<div class="col-xs-12 border-top text-center js-load-link hide" id="js-load-link2">
																			<a href="#" title="<%- i18next.t('View all activity') %>" id="js-notification-load-more-all" class="js-board-load-more-all btn btn-link">
																				<%- i18next.t("Load more activities") %>
																			</a>
																		</div>
																		<%} else { %>
																			<div class="col-xs-12 border-top text-center js-load-link" id="js-load-link">
																				<a href="#" title="<%- i18next.t('View all activity') %>" id="js-notification-load-more-all" class="js-all-load-more-all btn btn-link">
																					<%- i18next.t("Load more activities") %>
																				</a>
																			</div>
																			<% } %>
														</div>
														<ul class="nav nav-tabs <% if(_.isEmpty(board_id)){ %>hide<% } %>">
															<li>
																<a href="#all_" data-toggle="tab" class="js-all-activities">
																	<%- i18next.t('All') %>
																</a>
															</li>

															<% if(!_.isEmpty(board_id) && board_id !== 0 && board_id !== '0' && (!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "view_board_activities", board_user_role_id: parseInt(board.board_user_role_id)}))))) { %>
																<li class="active">
																	<a href="#board_" data-toggle="tab" class="js-board-activities">
																		<%- i18next.t("In this board") %>
																	</a>
																</li>
																<% } %>
														</ul>
													</div>
												</li>
												<% } else { %>
													<% if(board_id !== undefined && board_id !== null && board_id !== ""){ %>
														<li class="<% if(Backbone.history.fragment.indexOf('users/register') != -1){%>active<%}%>">
															<a href="#/users/register" title="<%- i18next.t('Register') %>">
																<strong>
																	<%- i18next.t("Register") %>
																</strong>
															</a>
														</li>
														<li class="<% if(Backbone.history.fragment.indexOf('users/login') != -1){%>active<%}%>">
															<a href="#/users/login" title="<%- i18next.t('Login') %>">
																<strong>
																	<%- i18next.t("Login") %>
																</strong>
															</a>
														</li>
														<% } %>
															<% } %>
				</ul>
			</div>
			<div class="hidden-blocks hide js-hidden-blocks"></div>
		</div>
	</section>
	<section class="search-block-main" id="search-page-result-block"></section>